import React from 'react'
import{ Redirect }from 'react-router-dom'

export default function Home({ location }) {
  if (!location.state) {
    // return <Redirect to="/login/code" />;
    return <h1>hello</h1>;
  }
  const { username, avatar } = location.state
  return (
    <div>
      <h1>{username}</h1>
      <img src={avatar} alt="avatar" />
    </div>
  )
}
